package com.crscd.ai.utils;

import org.springframework.ai.tool.annotation.Tool;

import java.time.LocalDateTime;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 10/9/25 2:54 PM
 * @modifiedBy:
 * @version: 1.0
 */
public class DateTimeTools {

  /**
   * Gets current time.
   * 1. 定义function call (tool call)
   * 2. returnDirect
   *   true: tool直接返回不走大模型，直接给客户
   *   false: 默认值，拿到tool返回的结果，给大模型，最后由大模型回复
   *
   * @return the current time
   */
  @Tool(description = "获取当前时间", returnDirect = false)
  public String getCurrentTime() {
    return LocalDateTime.now().toString();
  }
}
